const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('act_hi_entitylink', {
    id: {
      type: DataTypes.STRING(64),
      allowNull: false,
      primaryKey: true,
      field: 'ID_'
    },
    linkType: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'LINK_TYPE_'
    },
    createTime: {
      type: DataTypes.DATE(3),
      allowNull: true,
      field: 'CREATE_TIME_'
    },
    scopeId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SCOPE_ID_'
    },
    scopeType: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SCOPE_TYPE_'
    },
    scopeDefinitionId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SCOPE_DEFINITION_ID_'
    },
    refScopeId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'REF_SCOPE_ID_'
    },
    refScopeType: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'REF_SCOPE_TYPE_'
    },
    refScopeDefinitionId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'REF_SCOPE_DEFINITION_ID_'
    },
    hierarchyType: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'HIERARCHY_TYPE_'
    }
  }, {
    sequelize,
    tableName: 'act_hi_entitylink',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "ID_" },
        ]
      },
      {
        name: "ACT_IDX_HI_ENT_LNK_SCOPE",
        using: "BTREE",
        fields: [
          { name: "SCOPE_ID_" },
          { name: "SCOPE_TYPE_" },
          { name: "LINK_TYPE_" },
        ]
      },
      {
        name: "ACT_IDX_HI_ENT_LNK_SCOPE_DEF",
        using: "BTREE",
        fields: [
          { name: "SCOPE_DEFINITION_ID_" },
          { name: "SCOPE_TYPE_" },
          { name: "LINK_TYPE_" },
        ]
      },
    ]
  });
};
